package com.zfzs.post.controller;

import com.zfzs.post.aop.log.Log;
import com.zfzs.post.common.bean.ResponseResult;
import com.zfzs.post.model.dto.MineBenefitDetailDTO;
import com.zfzs.post.service.BenefitService;
import com.zfzs.post.service.FlowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
* 流水信息
* @author: ck
* @create: 2019/9/9/16:41
**/
@Slf4j
@RestController
@RequestMapping("flow/")
public class FlowController {

    @Autowired
    private BenefitService benefitService;

    @Autowired
    private FlowService flowService;

    /**
     * 我的:自营拓展/团队分润
     * @param dto
     * @return
     */
    @Log("我的:分润流水")
    @RequestMapping("get_mine_benefit_detail")
    public ResponseResult getMineBenefitDetail(@Validated @RequestBody MineBenefitDetailDTO dto){
        Map<String, Object> detail = benefitService.getMineBenefitDetail(dto);
        return ResponseResult.ok(detail);
    }

    /**
     * 我的：激活返现
     * @param dto
     * @return
     */
    @Log("我的:返现流水")
    @RequestMapping("get_mine_activ_detail")
    public ResponseResult getMineActivDetail(@Validated @RequestBody MineBenefitDetailDTO dto){
        Map<String, Object> detail = flowService.getMineActivDetail(dto);
        return ResponseResult.ok(detail);
    }

    /**
     * 我的其他收益
     * @param dto
     * @return
     */
    @Log("我的:其他流水")
    @RequestMapping("get_mine_other_detail")
    public ResponseResult getMineOtherDetail(@Validated @RequestBody MineBenefitDetailDTO dto){
        Map<String, Object> detail = flowService.getMineOtherDetail(dto);
        return ResponseResult.ok(detail);
    }

}
